package com.github.wui.utils.time

import android.os.CountDownTimer


/**
 *
 * 处理倒计时
 * @author <a href="https://github.com/karai-oss">Mr.xie</a>
 * @Date 2025/4/23
 */


class CountDown(total: Long, interval: Long, var finish: countDownCallBack,var hit: countDownHint) :
    CountDownTimer(total, interval) {
    override fun onTick(millisUntilFinished: Long) {
        hit(this);
    }

    override fun onFinish() {
        finish(this)
    }

}


typealias countDownCallBack = (countDowner : CountDown) -> Unit
typealias countDownHint = (countDowner : CountDown) -> Unit